import { createRouter, createWebHistory } from 'vue-router'

const routes = [
    {
        name: '登录',
        path: '/login',
        component: () => import('../views/login/Login.vue'),
    },
    {
        name: '/',
        path: '/',
        component: () => import('../layout/index.vue'),
        children:[
            // {
            //     name: 'mdEditor',
            //     path: '/md',
            //     component: () => import('../views/markdown.vue'),
            // },
            // 首页
            {
                name: 'home',
                path: '/',
                component: () => import('../views/home/index.vue'),
            },
            // 文章
            {
                name: 'draftBox',
                path: '/dB',
                component: () => import('../views/articlemanager/draftBox.vue'),
            },
            {
                name: 'publishedArticle',
                path: '/pA',
                component: () => import('../views/articlemanager/publishedArticle.vue'),
            },
            {
                name: 'recycleBin',
                path: '/rB',
                component: () => import('../views/articlemanager/recycleBin.vue'),
            },
            {
                name: 'categoryList',
                path: '/cL',
                component: () => import('../views/articlemanager/categoryList.vue'),
            },
            // 访客
            {
                name: 'message',
                path: '/mess',
                component: () => import('../views/vsitor/message.vue'),
            },


            // 个人中心
            {
                name: 'personalCenter',
                path: '/pce',
                component: () => import('../views/personalCenter/index.vue'),
            },
            {
                name: 'projrct',
                path: '/pro',
                component: () => import('../views/personalCenter/project.vue'),
            },
            {
                name: 'skill',
                path: '/sk',
                component: () => import('../views/personalCenter/skill.vue'),
            },
 



        ]
    },
    {
        name: '403',
        path: '/403',
        component: () => import('../views/403.vue'),
    },
    {
        name: '404',
        path: '/404',
        component: () => import('../views/404.vue'),
    },
    {
        name: 'mdEditor',
        path: '/md',
        component: () => import('../views/markdown.vue'),
    },
    {
        name: 'details',
        path: '/deta',
        component: () => import('../views/details.vue'),
    },

];

//这里不是通过new来创建，通过createRouter 方法创建，使用的模式不是通过mode来定义
const router = createRouter({
    routes,
    history: createWebHistory(),
})

export default router